using System;
using System.Threading.Tasks;
using SheLife.Domain.Entities;

namespace SheLife.Domain.Interfaces.Repositories
{
    /// <summary>
    /// 系统任务日志仓储接口
    /// </summary>
    public interface ISystemTaskLogRepository : IRepository<SystemTaskLog>
    {
        /// <summary>
        /// 根据任务ID获取任务日志列表
        /// </summary>
        /// <param name="taskId">任务ID</param>
        /// <returns>任务日志列表</returns>
        Task<IEnumerable<SystemTaskLog>> GetByTaskIdAsync(Guid taskId);

        /// <summary>
        /// 根据任务状态获取任务日志列表
        /// </summary>
        /// <param name="status">任务状态</param>
        /// <returns>任务日志列表</returns>
        Task<IEnumerable<SystemTaskLog>> GetByStatusAsync(string status);

        /// <summary>
        /// 根据时间范围获取任务日志列表
        /// </summary>
        /// <param name="startTime">开始时间</param>
        /// <param name="endTime">结束时间</param>
        /// <returns>任务日志列表</returns>
        Task<IEnumerable<SystemTaskLog>> GetByTimeRangeAsync(DateTime startTime, DateTime endTime);

        /// <summary>
        /// 获取最近的任务日志
        /// </summary>
        /// <param name="count">数量</param>
        /// <returns>任务日志列表</returns>
        Task<IEnumerable<SystemTaskLog>> GetRecentAsync(int count);

        /// <summary>
        /// 获取任务执行统计
        /// </summary>
        /// <param name="taskId">任务ID</param>
        /// <param name="startTime">开始时间</param>
        /// <param name="endTime">结束时间</param>
        /// <returns>任务执行统计</returns>
        Task<object> GetTaskStatisticsAsync(Guid taskId, DateTime startTime, DateTime endTime);
    }
}